<template>
  <el-descriptions direction="horizontal" :column="2" border>
    <el-descriptions-item label="头像" :span="2" ><el-avatar :size="40"  :src="pathUrl+'/getImage?path='+content.image"  @error="true"/></el-descriptions-item>
    <el-descriptions-item label="用户id" :span="2">{{content.userId}}</el-descriptions-item>
    <el-descriptions-item label="姓名" :span="2">{{content.realName}}</el-descriptions-item>
    <el-descriptions-item label="用户名/手机号" :span="2">{{content.username}}</el-descriptions-item>
    <el-descriptions-item label="身份证号" :span="2">{{content.idCard}}</el-descriptions-item>
    <el-descriptions-item label="注册时间" :span="2">{{content.registerDate}}</el-descriptions-item>
    <el-descriptions-item label="申请次数" :span="2">{{content.applyTimes}}</el-descriptions-item>
  </el-descriptions>
</template>

<script>
import axios from "axios";
import pathUrl from "@/main";
import {ElMessage} from "element-plus";

export default {
  name: "driverChild",
  props:{
    userId: Number
  },
  data(){
    return{
      pathUrl,
      content:{
        userId: '',
        username: '',
        password: '',
        idCard: '',
        registerDate: '',
        applyTimes: '',
        userType: '',
        image: '',
        realName: ''
      }
    }
  },
  mounted() {
    axios({
      method: 'post',
      url: '/api/manager/checkUser',
      data:{
        userId:this.userId

      }
    })
        .then((res)=>{

          if(res.data.code==="1"){//返回成功
            this.content=res.data.data.user
          }else{//返回失败
            // alert("查询失败")
            ElMessage.error('查询失败')
          }
        });
  }
}
</script>

<style scoped>
.el-descriptions{
  margin:10px 10px 10px 10px;
}
</style>